#!/bin/sh
# This regression test is a part of SIPp.
# The call debug file spells out the retransmissions of an INVITE that
# nobody answers.
. "`dirname "$0"`/../functions"; init

log=`mktemp`
sippfg -sn uac -i 127.0.0.1 -p 5070 127.0.0.1:5099 -m 1 \
    -max_invite_retrans 1 -trace_calldebug -calldebug_file "$log" \
    >/dev/null 2>&1
debug=`cat "$log"`
rm -f "$log"

if ! echo "$debug" | grep -q '^Call debugging information for call'; then
    fail "no call debugging information"
elif ! echo "$debug" | grep -q 'Retransmission required (1 retransmissions, max 1)'; then
    fail "no retransmission"
else
    ok
fi
